<template>
  <page-detail @scrollToLower="scrollToLower">
    <view style="padding: 10px">
      <dispute-card
          v-for="(item) in dataSource"
          :key="item.indexCode"
          :row="item"
          :typeList="typeList"
      />
      <van-empty v-if="!dataSource.length" description="暂无数据"/>
    </view>
    <template #footer>
      <van-button type="primary" text="记录纠纷" @click="submit" round style="width: 200px"></van-button>
    </template>
  </page-detail>
</template>

<script>
import disputeCard from "./components/disputeCard.vue";
import {getDict} from "../../api/tbDict";
import feedbackCard from "./components/feedbackCard.vue";
import pagingMixin from "../../mixins/pagingMixin";
export default {
  name: 'wx_pages_fzbz_dispute',
  components:{feedbackCard, disputeCard},
  mixins:[pagingMixin],
  data(){
    return{
      restfulApi:'/tbContradictionDispute/page',
      feedbackList: [],
      typeList:[]
    }
  },
  onPullDownRefresh() {
    this.search({approvalStatus:'1'})
  },
  methods:{
    submit(){
      this.$toPage('/pages/fzbz/disputeSubmit')
    },
  },
  onShow() {
    this.search({approvalStatus:'1'})
    getDict("dispute_type").then(res=>{
      this.typeList = res.data.map(item => ({
        text: item.dictValue,
        value: item.dictKey
      }));
    })
  }
}
</script>
